﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:GenericControl="clr-namespace:AR.Controls"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">

    <Style TargetType="GenericControl:MenuBar">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GenericControl:MenuBar">
                    <Canvas x:Name="LayoutRootMB">
                        <StackPanel Height="28" x:Name="baseRectMB" Canvas.Left="0" Canvas.Top="0"  HorizontalAlignment="Center" Orientation="Horizontal" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="GenericControl:MenuBarItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GenericControl:MenuBarItem">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="menuNavigationMBI">
                                <vsm:VisualState x:Name="ItemHighlightedMBI">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ItemHighlightMBI" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="noneHighlightedMBI"/>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Canvas x:Name="LayoutRootMBI" Height="28" Width="78" Background="{StaticResource HighLightColorBrush}">
                            <Rectangle Height="28" Width="78" x:Name="ItemrMBI" Opacity="1" Fill="{StaticResource HighLightColorBrush}" Stroke="{x:Null}"/>
                            <TextBlock Height="28" Text="NaN" x:Name="ItemTextMBI" Width="78" Canvas.Left="6" Canvas.Top="5" Canvas.ZIndex="0" Foreground="#FFFFFFFF" TextWrapping="Wrap" />

                            <Canvas Height="28" Width="78" x:Name="ItemHighlightMBI"  Opacity="0" Canvas.Left="0" Canvas.Top="0" >
                                <Rectangle Height="28" Width="78" x:Name="ItemHighlightrMBI" Opacity="1" Fill="{StaticResource HighLightColorBrush}" Stroke="{x:Null}"/>
                                <TextBlock Height="28" Text="NaN" x:Name="ItemText_copyMBI" Width="78" Canvas.Left="6" Canvas.Top="5" Canvas.ZIndex="0" Foreground="#FFFFFFFF" TextWrapping="Wrap" />
                            </Canvas>
                        </Canvas>
                        
                        <Canvas>
                            <Canvas Height="92" Width="166" x:Name="ItemDropDownMBI" Opacity="1" Visibility="Collapsed" Canvas.Left="0" Canvas.Top="26">
                                <Rectangle Height="92" x:Name="baseRectMBI" Width="166" Fill="{StaticResource HighLightColorBrush}" Stroke="{StaticResource HighLightColorBrush}" Canvas.ZIndex="1" Canvas.Left="0" Canvas.Top="0"/>
                                <StackPanel x:Name="itemHolderMBI" Orientation="Vertical" Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="2"></StackPanel>
                            </Canvas>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    
    <Style TargetType="GenericControl:MenuItem">
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GenericControl:MenuItem">

                    <Canvas x:Name="LayoutRootMI" Background="{StaticResource HighLightColorBrush}" >
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="menuNavigationMI">
                                <vsm:VisualState x:Name="ItemHighlightedMI">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemHighlightMI" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="noneHighlightedMI">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemHighlightMI" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>

                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Canvas Height="28" x:Name="LayoutRootMI2" Background="{StaticResource HighLightColorBrush}" Width="14" >

                            <TextBlock x:Name="ItemTextMI"   Canvas.Left="6" Canvas.Top="9" Height="28" Width="90" Canvas.ZIndex="0" TextWrapping="Wrap" Foreground="#2113f9" Text="Default"></TextBlock>
                            <Path x:Name="arrow" Visibility="Collapsed" Canvas.Left="77" Canvas.Top="13" Height="28" Width="6" Fill="{StaticResource HighLightColorBrush}" Stretch="Fill"  Data="M329.83331,173.49998 L329.83331,185.99998 L340.99969,179.83331 z" RenderTransformOrigin="0.5,0.5" />

                            <!-- Highlighted interface -->
                            <Canvas Height="28" x:Name="ItemHighlightMI" Width="149" Opacity="0" Canvas.ZIndex="1" Canvas.Left="0" Canvas.Top="0" >
                                <Rectangle Height="28" x:Name="ItemHighlightrMI" Width="162" Opacity="1" Canvas.Left="4" Canvas.Top="4" Fill="#2113f9" Stroke="{x:Null}"  />
                                <TextBlock x:Name="ItemText_copyMI" Canvas.Left="6" Canvas.Top="9" Canvas.ZIndex="0" Height="28" Width="90" TextWrapping="Wrap" Foreground="#FFFFFFFF" Text="Default"></TextBlock>
                                <Path x:Name="arrowHighlight" Visibility="Collapsed" Canvas.Left="77" Canvas.Top="13" Height="28" Width="6" Fill="{StaticResource HighLightColorBrush}" Stretch="Fill"  Data="M329.83331,173.49998 L329.83331,185.99998 L340.99969,179.83331 z" RenderTransformOrigin="0.5,0.5" />
                            </Canvas>
                            
                            <!-- nested menu interface -->
                            <Canvas>
                                <Canvas Height="92" Width="166" x:Name="ItemDropDownMI" Opacity="1" Visibility="Collapsed" Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="1">
                                    <Rectangle Height="87.334" x:Name="baseRectMI" Width="166" Fill="{StaticResource HighLightColorBrush}" Stroke="#FF9D9492" Canvas.ZIndex="1" Canvas.Left="0" Canvas.Top="0"/>
                                    <StackPanel x:Name="itemHolderMI" Orientation="Vertical" Canvas.Left="0" Canvas.Top="0" Canvas.ZIndex="2"></StackPanel>
                                </Canvas>
                            </Canvas>
                            
                        </Canvas>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


</ResourceDictionary>